package main

import (
	"context"
	"encoding/json"
	"fmt"
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu"
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu/config"
	"gitee.com/leo-xin/novel_distribution_sdk_go/changdu/enums"
	"io"
)

func getPackageListV2Example() {

	ctx := context.Background()

	configuration := config.NewConfiguration()
	apiClient := changdu.Init(configuration)

	resp, httpRes, err := apiClient.GetPackageListV2Api().
		Get(ctx).
		SecretKey(SecretKey).
		DistributorId(DistributorId).AppType(enums.H5_AppType).PageIndex(1).PageSize(10).
		Execute()

	s, _ := json.Marshal(resp)
	fmt.Println(string(s))

	resBytes, _ := io.ReadAll(httpRes.Body)
	fmt.Println(string(resBytes))
	fmt.Println(err)

}
